﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>@ViewBag.Title - My ASP.NET Application</title>
    @Styles.Render("~/Content/css")
    <link href="//code.ionicframework.com/ionicons/1.5.2/css/ionicons.min.css" rel="stylesheet" type="text/css" />
    <link href="~/Content/morris.css" rel="stylesheet" />
    @Scripts.Render("~/bundles/modernizr")
   
</head>



<body class="skin-blue">
    <!-- header logo: style can be found in header.less -->
    <header class="header">
        <a href="/" class="logo">
            <!-- Add the class icon to your logo image or logo icon to add the margining -->
            CC HelpDesk
        </a>
        <!-- Header Navbar: style can be found in header.less -->
        <nav class="navbar navbar-static-top" role="navigation">
            <!-- Sidebar toggle button-->
            <a href="#" class="navbar-btn sidebar-toggle" data-toggle="offcanvas" role="button">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </a>
            <div class="navbar-right">
                <ul class="nav navbar-nav">

                    <!-- User Account: style can be found in dropdown.less -->
                  @Html.Partial("_LoginPartial")
                </ul>
            </div>
        </nav>
    </header>

   

    <div class="wrapper row-offcanvas row-offcanvas-left">
        <!-- Left side column. contains the logo and sidebar -->
        <aside class="left-side sidebar-offcanvas">
            <!-- sidebar: style can be found in sidebar.less -->
            <section class="sidebar">
                <!-- Sidebar user panel -->
             @using Microsoft.AspNet.Identity
            @if (Request.IsAuthenticated)
            {

                <div class="user-panel">
                    <div class="pull-left image">
                        <img src="~/Content/imgs/avatar3.png" class="img-circle" alt="User Image" />
                    </div>
                    <div class="pull-left info">
                        <p>Hello, @HelpDeskTicketingApp.Adapters.DataAdapters.TicketDataAdapter.GetUserDisplayNameStatic(User.Identity.GetUserId())</p>

                        <a href="#"><i class="fa fa-circle text-success"></i> Online</a>
                    </div>
                </div>
            }
                  
                
                
                <!-- search form -->
                <!-- /.search form -->
                <!-- sidebar menu: : style can be found in sidebar.less -->
                <ul class="sidebar-menu">
                  
                    @if (Request.IsAuthenticated && User.IsInRole("Admin"))
                    {
                        <li class="active">
                            <a href="/Admin/Dashboard">
                                <i class="glyphicon glyphicon-dashboard"></i> <span>Dashboard</span>
                            </a>
                        </li>
                        
                        <li class="treeview">
                            <a href="#">
                                <i class="glyphicon glyphicon-barcode"></i>
                                <span>Tickets</span>
                                <i class="glyphicon pull-right glyphicon-collapse-down"></i>
                            </a>
                            <ul class="treeview-menu">
                                <li>
                                    <a href="/Admin/Tickets">
                                        <i class="glyphicon glyphicon-list-alt"></i>
                                        <span>All Tickets</span> <small class="badge pull-right bg-green">new</small>
                                    </a>
                                </li>
                                <li>
                                    <a href="/Home/AddTicket">
                                        <i class="glyphicon glyphicon-new-window"></i> <span>Create new ticket</span>

                                    </a>
                                </li>

                            </ul>
                        </li>
                       
                        <li class="treeview">
                            <a href="#">
                                <i class="glyphicon glyphicon-user"></i>
                                <span>Users</span>
                                <i class="glyphicon pull-right glyphicon-collapse-down"></i>
                            </a>
                            <ul class="treeview-menu">
                                <li>
                                    <a href="/Admin/Users">
                                        <i class="fa fa-th"></i> <span>All Users</span>
                                    </a>
                                </li>
                                <li>
                                    <a href="/Admin/Users?role=Technician">
                                        <i class="fa fa-th"></i> <span>Technicians</span>
                                    </a>
                                </li>
                                <li>
                                    <a href="/Admin/Users?role=General">
                                        <i class="fa fa-th"></i> <span>General Users</span>
                                    </a>
                                </li>
                                <li>
                                    <a href="/Admin/Users?role=Admin">
                                        <i class="fa fa-th"></i> <span>Admins</span>
                                    </a>
                                </li>

                            </ul>
                        </li>
                    
                         <li>
                              <a href="/Admin/Stats">
                                  <i class="glyphicon glyphicon-stats"></i> <span>Stats</span>
                              </a>
                            </li>



                    }
                    
                    @if (Request.IsAuthenticated && User.IsInRole("Technician"))
                    {

                    <li>
                        <a href="/Technician">
                            <i class="glyphicon glyphicon-list-alt"></i>
                            <span>Tickets</span> <small class="badge pull-right bg-green">new</small>
                        </a>
                    </li>
                    <li>
                        <a href="/Home/AddTicket">
                            <i class="glyphicon glyphicon-new-window"></i> <span>Create new ticket</span>

                        </a>
                    </li>

                    }

                    @if (Request.IsAuthenticated && !User.IsInRole("Admin") && !User.IsInRole("Technician"))
                    {
                      
                       


                        <li>
                            <a href="/Home/ViewTickets">
                                <i class="glyphicon glyphicon-list-alt"></i> <span>View Tickets</span>

                            </a>
                        </li>

                            <li>
                                <a href="/Home/AddTicket">
                                    <i class="glyphicon glyphicon-new-window"></i> <span>Create new ticket</span>

                                </a>
                            </li>

                        <li>
                            <a href="/Home/Contact">
                                <i class="glyphicon glyphicon-envelope"></i> <span>Contact </span>

                            </a>
                        </li>

                    }

                     <li>
                        <a href="/Admin/sof">
                            <i class="glyphicon glyphicon-search"></i> <span>Knowledge Base</span>
                        </a>
                    </li>
                   
                   
                </ul>
            </section>
            <!-- /.sidebar -->
        </aside>

        <!-- Right side column. Contains the navbar and content of the page -->
        <aside class="right-side">
            <!-- Content Header (Page header) -->
            <section class="content-header">
                <h1>
                    @ViewBag.User
                    <small>Control panel</small>
                </h1>
                <ol class="breadcrumb">
                    <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
                    <li class="active">@ViewBag.Page</li>
                </ol>
            </section>

            <!-- Main content -->
            <section class="content">

                @RenderBody()


            </section><!-- /.content -->
        </aside><!-- /.right-side -->
    </div><!-- ./wrapper -->
    @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/bundles/bootstrap")
    
    <script src="~/Scripts/dataTable.js"></script>   
    <script src="~/Scripts/dataTables.bootstrap.js"></script>  
    @RenderSection("scripts", required: false)

    <script type="text/javascript">
    $(function () {

        $('#TicketsTable').dataTable();
        
    });
    </script>




</body>
</html>

